package cn.springcloudtest.client;

import cn.springcloudtest.fallback.TopicClientFallback;
import cn.springcloudtest.pojo.Topic;
import cn.springcloudtest.utils.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @ProjectName:springcloud-common-api
 * @Author:赵伟杰
 * @Date:2021年09月05日 10:50
 */
@FeignClient(name = "springcloud-topic-provider", fallback = TopicClientFallback.class)
public interface TopicClient {

    @RequestMapping("/local/getTopicById")
    public Topic getTopicById(@RequestParam Integer id) throws Exception;

    @RequestMapping("/local/getTopicListByMap")
    public List<Topic> getTopicListByMap(@RequestBody Map<String, Object> param) throws Exception;

     @RequestMapping("/local/getTopicCountByMap")
    public Integer getTopicCountByMap(@RequestBody Map<String, Object> param) throws Exception;

     @RequestMapping("/local/AddTopic")
    public Integer addTopic(@RequestBody Topic topic) throws Exception;

     @RequestMapping("/local/ModifyTopic")
    public Integer modifyTopic(@RequestBody Topic topic) throws Exception;

     @RequestMapping("/local/deleteTopicById")
    public Integer deleteTopicById(@RequestParam Integer id) throws Exception;

     @RequestMapping("/local/queryTopicPageByMap")
    public Page<Topic> queryTopicPageByMap(@RequestBody Map<String, Object> param) throws Exception;
}
